package com.langfeiyes.pattern.interpret.demo1;

//加法
public class NumExpression implements Expression{
    private int num;
    public NumExpression(int num){
        this.num = num;
    }
    public NumExpression(String num){
        this.num = Integer.parseInt(num);
    }
    @Override
    public int interpret() {
        return this.num;
    }

    @Override
    public String toString() {
        return num+"";
    }
}
